$success = $this->_File->ftruncate(0) &&
$this->_File->fwrite($contents) &&
$this->_File->fflush();
SplFileObject::fwrite() [internal], line ?? Cake\Cache\Engine\FileEngine::set() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php, line 140 Cake\Database\Schema\CachedCollection::describe() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php, line 93 Cake\ORM\Table::getSchema() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 521 Cake\ORM\Query::addDefaultTypes() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Query.php, line 290 Cake\ORM\Query::__construct() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Query.php, line 184 Cake\ORM\Table::query() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 1700 Cake\ORM\Table::find() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 1255 App\Model\Table\LinksTable::getLanguageByUrl() /home/live1740/domains/takaotile.vn/public_html/web4s/src/Model/Table/LinksTable.php, line 117 App\Controller\AppController::beforeFilter() /home/live1740/domains/takaotile.vn/public_html/web4s/src/Controller/AppController.php, line 93 Cake\Event\EventManager::_callListener() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventManager.php, line 309 Cake\Event\EventManager::dispatch() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventManager.php, line 286 Cake\Controller\Controller::dispatchEvent() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php, line 92 Cake\Controller\Controller::startupProcess() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/Controller.php, line 644 Cake\Controller\ControllerFactory::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 129 Cake\Controller\ControllerFactory::invoke() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114 Cake\Http\BaseApplication::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Middleware\CsrfProtectionMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 164 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Routing\Middleware\RoutingMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 192 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Routing\Middleware\AssetMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Server::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /home/live1740/domains/takaotile.vn/public_html/index.php, line 35
$success = $this->_File->ftruncate(0) &&
$this->_File->fwrite($contents) &&
$this->_File->fflush();
SplFileObject::fwrite() [internal], line ?? Cake\Cache\Engine\FileEngine::set() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php, line 140 Cake\Database\Schema\CachedCollection::describe() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php, line 93 Cake\ORM\Table::getSchema() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 521 Cake\ORM\Query::addDefaultTypes() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Query.php, line 290 Cake\ORM\Query::__construct() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Query.php, line 184 Cake\ORM\Table::query() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 1700 Cake\ORM\Table::find() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/ORM/Table.php, line 1255 App\Model\Table\LinksTable::getLanguageByUrl() /home/live1740/domains/takaotile.vn/public_html/web4s/src/Model/Table/LinksTable.php, line 127 App\Controller\AppController::beforeFilter() /home/live1740/domains/takaotile.vn/public_html/web4s/src/Controller/AppController.php, line 93 Cake\Event\EventManager::_callListener() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventManager.php, line 309 Cake\Event\EventManager::dispatch() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventManager.php, line 286 Cake\Controller\Controller::dispatchEvent() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php, line 92 Cake\Controller\Controller::startupProcess() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/Controller.php, line 644 Cake\Controller\ControllerFactory::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 129 Cake\Controller\ControllerFactory::invoke() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114 Cake\Http\BaseApplication::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Middleware\CsrfProtectionMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 164 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Routing\Middleware\RoutingMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 192 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Routing\Middleware\AssetMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131 Cake\Http\Runner::handle() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Server::run() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /home/live1740/domains/takaotile.vn/public_html/index.php, line 35
$message = "Unable to emit headers. Headers sent in file=$file line=$line";
trigger_error($message, E_USER_WARNING);
}
Cake\Http\ResponseEmitter::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\Server::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/live1740/domains/takaotile.vn/public_html/index.php, line 35
$response->getStatusCode(),
($reasonPhrase ? ' ' . $reasonPhrase : '')
));
header [internal], line ?? Cake\Http\ResponseEmitter::emitStatusLine() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 168 Cake\Http\ResponseEmitter::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\Server::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/live1740/domains/takaotile.vn/public_html/index.php, line 35
foreach ($values as $value) {
header(sprintf(
'%s: %s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitHeaders() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\Server::emit() /home/live1740/domains/takaotile.vn/public_html/web4s/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/live1740/domains/takaotile.vn/public_html/index.php, line 35
CORE/src/Error/Renderer/HtmlErrorRenderer.php
on line 36
📋
$request = $this->controller->getRequest();
|
|
$lang = $request->getSession()->read(LANG_FRONTEND);
|
|
if(empty($lang)){
|
|
$lang = TableRegistry::get('Languages')->getDefaultLanguage();
|
|
$request->getSession()->write(LANG_FRONTEND, $lang);
|
|
}
|
|
|
|
return $lang;
|
|
}
|
$url = !empty($this->request->getUri()) ? substr($this->request->getUri()->getPath(), 1) : null;
|
|
$url = !empty($url) ? urldecode($url) : '';
|
|
$language = TableRegistry::get('Links')->getLanguageByUrl($url);
|
|
|
|
if(empty($language)) $language = $this->loadComponent('System')->getLanguageFrontend();
|
|
if(empty($language)) die('Không lấy được thông tin ngôn ngữ của Website');
|
|
|
|
// currency
|
|
$currency_default = TableRegistry::get('Currencies')->getDefaultCurrency();
|
protected function _callListener(callable $listener, EventInterface $event) |
|
{ |
|
$data = (array)$event->getData(); |
|
|
|
return $listener($event, ...array_values($data)); |
|
} |
|
|
|
/** |
|
* @inheritDoc |
foreach ($listeners as $listener) { |
|
if ($event->isStopped()) { |
|
break; |
|
} |
|
$result = $this->_callListener($listener['callable'], $event); |
|
if ($result === false) { |
|
$event->stopPropagation(); |
|
} |
|
if ($result !== null) { |
} |
|
|
|
/** @var \Cake\Event\EventInterface $event */ |
|
$event = new $this->_eventClass($name, $subject, $data); |
|
$this->getEventManager()->dispatch($event); |
|
|
|
return $event; |
|
} |
|
} |
* @return \Psr\Http\Message\ResponseInterface|null |
|
*/ |
|
public function startupProcess(): ?ResponseInterface |
|
{ |
|
$event = $this->dispatchEvent('Controller.initialize'); |
|
if ($event->getResult() instanceof ResponseInterface) { |
|
return $event->getResult(); |
|
} |
|
$event = $this->dispatchEvent('Controller.startup'); |
$controller = $this->controller; |
|
/** @psalm-suppress ArgumentTypeCoercion */ |
|
$controller->setRequest($request); |
|
|
|
$result = $controller->startupProcess(); |
|
if ($result instanceof ResponseInterface) { |
|
return $result; |
|
} |
|
|
|
|
return $runner->run($middlewareQueue, $controller->getRequest(), $this); |
|
} |
|
|
|
return $this->handle($controller->getRequest()); |
|
} |
|
|
|
/** |
|
* Invoke the action. |
} |
|
|
|
$controller = $this->controllerFactory->create($request); |
|
|
|
return $this->controllerFactory->invoke($controller); |
|
} |
|
} |
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
if ($method === 'GET' && $cookieData === null) { |
|
$token = $this->createToken(); |
|
$request = $request->withAttribute('csrfToken', $this->saltToken($token)); |
|
/** @var mixed $response */ |
|
$response = $handler->handle($request); |
|
|
|
return $this->_addTokenCookie($token, $request, $response); |
|
} |
|
|
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
) { |
|
Router::setRequest($request); |
|
} |
|
|
|
return $this->handle($request); |
|
} |
|
|
|
/** |
|
* Handle incoming server request and return a response. |
|
|
$middleware = new MiddlewareQueue($matching); |
|
$runner = new Runner(); |
|
|
|
return $runner->run($middleware, $request, $handler); |
|
} |
|
} |
|
|
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
$url = $request->getUri()->getPath(); |
|
if (strpos($url, '..') !== false || strpos($url, '.') === false) { |
|
return $handler->handle($request); |
|
} |
|
|
|
if (strpos($url, '/.') !== false) { |
|
return $handler->handle($request); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
try { |
|
return $handler->handle($request); |
|
} catch (RedirectException $exception) { |
|
return $this->handleRedirect($exception); |
|
} catch (Throwable $exception) { |
|
return $this->handleException($exception, $request); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
) { |
|
Router::setRequest($request); |
|
} |
|
|
|
return $this->handle($request); |
|
} |
|
|
|
/** |
|
* Handle incoming server request and return a response. |
} |
|
|
|
$this->dispatchEvent('Server.buildMiddleware', ['middleware' => $middleware]); |
|
|
|
$response = $this->runner->run($middleware, $request, $this->app); |
|
|
|
if ($request instanceof ServerRequest) { |
|
$request->getSession()->close(); |
|
} |
// Bind your application to the server.
|
|
$server = new Server(new Application($core_path . '/config'));
|
|
|
|
// Run the request/response through the application and emit the response.
|
|
$server->emit($server->run());
|
|
|
If you want to customize this error message, create templates/Error/error500.php